package com.chagee.channel.server.event.service;


import com.chagee.channel.api.bo.oss.*;
import com.chagee.channel.api.bo.oss.UploadOssRequestV2;
import com.chagee.channel.server.event.dto.OssCallbackResult;
import com.chagee.channel.server.event.dto.OssPolicyResult;
import com.chagee.channel.server.event.model.OssPolicyParam;
import javax.servlet.http.HttpServletRequest;

/**
 * oss上传管理Service
 * Created by macro on 2018/5/17.
 */
public interface OssService {

    /**
     * oss上传策略生成
     *
     * @param param
     */
    OssPolicyResult policy(OssPolicyParam param);

    /**
     * oss上传成功回调
     */
    OssCallbackResult callback(HttpServletRequest request);

    /**
     * oss获取签名URL
     */
    SignedURLRep signedURL(SignedURLReq param);

    String createDir();

    /**
     * 取视频第一帧
     * @author yangyang
     * @date 2024/5/11 14:45
     * @param param 请求
     * @return com.chagee.channel.api.bo.oss.SignedURLRep
     */
    SignedURLRep firstFrameOfVideo(SignedURLReq param);

    /**
     * oss删除文件
     * @param param
     */
    void deleteFile(OssPolicyParam param);

    int toMP4(FileNameListReq fileNamelist) ;

    String getMP4( String objectName);

    boolean doesObjectExist(String ossUrl);

    /**
     * 上传文件至oss
      * @param req
     * @return
     */
    String uploadByUrl(UploadOssRequest req);

    String upload(String bucketName, byte[] pic, String fileName);

    String upload(byte[] pic, String fileName);
	/**
	 * 文档转换
	 * @author yangyang
	 * @date 2024/7/9 10:11
	 * @param req 请求
	 * @return com.chagee.channel.api.bo.oss.DocumentConversionRep
	 */
	DocumentConversionRep documentConversion(DocumentConversionReq req);
}
